<%@ page import="com.portico.dept.solarch.ProjectQuality" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="layout" content="thin"/>
    <g:set var="entityName" value="${message(code: 'projectQuality.label', default: 'ProjectQuality')}"/>
    <title><g:message code="default.create.label" args="[entityName]"/></title>
</head>

<body>
%{--<div class="nav">--}%
%{--<span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>--}%
%{--<span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>--}%
%{--</div>--}%
<div class="body">
    %{--<h1><g:message code="default.create.label" args="[entityName]"/></h1>--}%
    <g:if test="${flash.message}">
        <div class="message">${flash.message}</div>
    </g:if>
    <g:hasErrors bean="${projectQualityInstance}">
        <div class="errors">
            <g:renderErrors bean="${projectQualityInstance}" as="list"/>
        </div>
    </g:hasErrors>
    <div id="result">
        <g:formRemote name="projectQuality"
                      url="[controller:'projectQuality', action:'save' ]" update="result">
            <div class="dialog">
                <table>
                    <tbody>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="buildName"><g:message code="projectQuality.buildName.label"
                                                              default="Build Name"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectQualityInstance, field: 'buildName', 'errors')}">
                            <g:textField name="buildName" value="${projectQualityInstance?.buildName}"/>
                        </td>
                        <td valign="top" class="name">
                            <label for="issueStatus"><g:message code="projectQuality.issueStatus.label"
                                                                default="Issue Status"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectQualityInstance, field: 'issueStatus', 'errors')}">
                            <g:select name="issueStatus" from="${projectQualityInstance.constraints.issueStatus.inList}"
                                      value="${projectQualityInstance?.issueStatus}"
                                      valueMessagePrefix="projectQuality.issueStatus"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="type"><g:message code="projectQuality.type.label" default="Type"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectQualityInstance, field: 'type', 'errors')}">
                            <g:select name="type" from="${projectQualityInstance.constraints.type.inList}"
                                      value="${projectQualityInstance?.type}" valueMessagePrefix="projectQuality.type"/>
                        </td>
                        <td valign="top" class="name">
                            <label for="subType"><g:message code="projectQuality.subType.label"
                                                            default="Sub Type"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectQualityInstance, field: 'subType', 'errors')}">
                            <g:select name="subType" from="${projectQualityInstance.constraints.subType.inList}"
                                      value="${projectQualityInstance?.subType}"
                                      valueMessagePrefix="projectQuality.subType"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="comments"><g:message code="projectQuality.comments.label"
                                                             default="Comments"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectQualityInstance, field: 'comments', 'errors')}">
                            <g:textArea name="comments" cols="10" rows="2" value="${projectQualityInstance?.comments}"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="status"><g:message code="projectQuality.status.label" default="Status"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectQualityInstance, field: 'status', 'errors')}">
                            <g:select name="status" from="${projectQualityInstance.constraints.status.inList}"
                                      value="${projectQualityInstance?.status}"
                                      valueMessagePrefix="projectQuality.status"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        %{--<td valign="top" class="name">--}%
                            %{--<label for="blockerCount"><g:message code="projectQuality.blockerCount.label"--}%
                                                                 %{--default="Blocker Count"/></label>--}%
                        %{--</td>--}%
                        %{--<td valign="top"--}%
                            %{--class="value ${hasErrors(bean: projectQualityInstance, field: 'blockerCount', 'errors')}">--}%
                            %{--<g:textField name="blockerCount"--}%
                                         %{--value="${fieldValue(bean: projectQualityInstance, field: 'blockerCount')}"/>--}%
                        %{--</td>--}%
                        %{--</td>--}%
                        <td valign="top" class="name">
                            <label for="clientReported"><g:message code="projectQuality.clientReported.label"
                                                                   default="Client Reported"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectQualityInstance, field: 'clientReported', 'errors')}">
                            <g:checkBox name="clientReported" value="${projectQualityInstance?.clientReported}"/>
                        </td>
                         <td valign="top" class="name">
                            <label for="project"><g:message code="projectQuality.project.label"
                                                            default="Project"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectQualityInstance, field: 'project', 'errors')}">
                            <g:select name="project.id" from="${com.portico.dept.solarch.Project.list()}" optionKey="id"
                                      value="${projectQualityInstance?.project?.id}"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="createdOn"><g:message code="projectQuality.createdOn.label"
                                                              default="Created On"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectQualityInstance, field: 'createdOn', 'errors')}">
                            <g:datePicker name="createdOn" precision="day"
                                          value="${projectQualityInstance?.createdOn}"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="blockerCount"><g:message code="projectQuality.blockerCount.label"
                                                                 default="Blocker Count"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectQualityInstance, field: 'blockerCount', 'errors')}">
                            <g:textField name="blockerCount"
                                         value="${fieldValue(bean: projectQualityInstance, field: 'blockerCount')}"/>
                        </td>
                        <td valign="top" class="name">
                            <label for="criticalCount"><g:message code="projectQuality.criticalCount.label"
                                                                  default="Critical Count"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectQualityInstance, field: 'criticalCount', 'errors')}">
                            <g:textField name="criticalCount"
                                         value="${fieldValue(bean: projectQualityInstance, field: 'criticalCount')}"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="majorCount"><g:message code="projectQuality.majorCount.label"
                                                               default="Major Count"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectQualityInstance, field: 'majorCount', 'errors')}">
                            <g:textField name="majorCount"
                                         value="${fieldValue(bean: projectQualityInstance, field: 'majorCount')}"/>
                        </td>
                        <td valign="top" class="name">
                            <label for="minorCount"><g:message code="projectQuality.minorCount.label"
                                                               default="Minor Count"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectQualityInstance, field: 'minorCount', 'errors')}">
                            <g:textField name="minorCount"
                                         value="${fieldValue(bean: projectQualityInstance, field: 'minorCount')}"/>
                        </td>
                    </tr>


                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="trivialCount"><g:message code="projectQuality.trivialCount.label"
                                                                 default="Trivial Count"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectQualityInstance, field: 'trivialCount', 'errors')}">
                            <g:textField name="trivialCount"
                                         value="${fieldValue(bean: projectQualityInstance, field: 'trivialCount')}"/>
                        </td>
                    </tr>

                    </tbody>
                </table>
            </div>

            <div class="buttons">
                <span class="button"><g:submitButton name="create" class="save"
                                                     value="${message(code: 'default.button.create.label', default: 'Create')}"/></span>
            </div>
        </g:formRemote></div>
</div>
</body>
</html>
